Ext.onReady(function(){
	//获取id作为树节点id
	function number(){
		return document.getElementById('droppableH').childNodes[0].childNodes.length;
	}
	
    var Docs = {};    
    Docs.classData={    
        "id":"root",    
        "text":"宾栏",    
        "singleClickExpand":true,    
        "expanded":true,    
        "leaf":false
    };   

  //树
    var treeBL = new Ext.tree.TreePanel({
    	id:'treeBL',
    	height:608,
		autoScroll: true,
		collapsible: true,
		ddGroup: 'customDDGroup',
		animate:false,
		split: true,
		margins: '2 2 2 2',
		useArrows:true,
		rootVisible : false,
    	loader: new Ext.tree.TreeLoader({    
            preloadChildren: true,//若为true，则loader在节点第一次访问时加载"children"的属性    
            clearOnLoad: false//（可选）默认为true。在读取数据前移除已存在的节点    
        }),    
    	root: Docs.classData,
    	listeners:{
			click:function(node){
				var o = new Object();
				if(node.attributes.comColumn=='true'){
					o.text=node.attributes.table;
				}
				else{
					o.text='$'+node.attributes.table+'.'+node.attributes.column;
					/*
						if(node.attributes.table.indexOf("[year]") != -1){
							o.text='$'+node.attributes.table+'.'+node.attributes.column;
						}else{
							o.text='$'+node.attributes.table+node.attributes.time.substring(4)+'.'+node.attributes.column;
						}
					 */
				}
        		addquery(o,'selColumnSql_');
			}
    	}
    });
    
	//标签页
	var tabs = new Ext.TabPanel({
		resizeTabs:true, // tab宽度自动调整
		tabWidth:70,		//tab初始宽度
		width:all_width * 20 / 100,
		enableTabScroll:true,//tab超出范围出现横向滚动条
		frame:true,
		activeTab:0,
		region: 'west',
		defaults: {bodyStyle:'background:#dfe8f6;border: 1px solid #dfe8f6'}, 
		items:[{
			id:'tab1_1',
			title:'指标分类',
			layout:'fit',
			items:[{
				id: 'tree-panel-measures',
				autoScroll: true,
				collapsible: true,
				animate:false,
				ddGroup: 'customDDGroup',
				split: true,
				margins: '2 2 2 2',
				useArrows:true,
				rootVisible : false,
				xtype: 'treepanel',
				root: {text: '指标分类',draggable: false,id: '-1',isRoot:true},
				loader: new Ext.tree.TreeLoader({ 
						dataUrl: getRootPath()+'/detailReport.report?decorate=no',
						listeners:{beforeload:function(treeLoader, node){
							if(node.attributes.isRoot==true){
								this.baseParams.method = "getRoot";
							}else{
								this.baseParams.method = "getChilds";
							}
							this.baseParams.xmlId = xml_id_;
							this.baseParams.tableName = node.attributes.table;
							this.baseParams.pid = node.attributes.pid;
							this.baseParams.level = node.attributes.level;
							this.baseParams.dir = node.attributes.d;
							this.baseParams.time = node.attributes.time;
							this.baseParams.currentTime = jQuery("#currentTime").val();
							
					   }}
				}),
				listeners:{
					beforeappend:function(tree,parent,node){
	         		//判断是否是报告期
						//if(node.attributes.isTime=='true'){
							//return false;	
						//}else{
							//return true;
						//}
	         	},
				click:function(node){
					if(node.leaf){
						var o = new Object();
						o.text='$'+node.attributes.table+'.'+node.attributes.column;
	            		addquery(o,'selColumnSql_');
					}
				}
				}
			}]	//添加table
		},{
			id:'tab1_2',
			title:'宾栏',
			items:[treeBL]
		}]
	});
	//by mengqingyu modify end
	//添加自定义宾栏
	var advancedColumnWindow_ = new Ext.Window({	
		width:670,	
    	height: 500,
    	layout: "border",
    	title:'添加自定义宾栏',
    	modal: true,
    	border:false,
    	id: "customH_win_",
    	closeAction: 'hide',
	    items: [tabs
	        ,{
	        	region:'center',
	        	width:320,
	        	height: 500,
	        	margins: '2 2 0 2',
	        	items:new Ext.TabPanel({
	        		activeTab: 0,
	        		items:[
	        		{
	        		title:'高级模式',
	        		layout: 'table',
	        		height: 500,
	        		border:false,
	        		bodyStyle:'padding:10px 10px 10px 20px',
	        		layoutConfig: {columns:5},
	        		defaults:{frame:false,style:'padding:2px',minWidth: '60',style:{marginBottom: '10px'}},
	        		items:[
    		         {
    		    	    id:'selColumnName_',
    		    	    xtype:'textfield',
    		    	    width  : 350,
    		    	    colspan:5,
    		    	    emptyText:'请输入自定义列名称',
    		    	    allowBlank:false,
    		    	    blankText:'自定义列名称不能为空'
    		         },
	        		 {
			            xtype: "textarea",
			            id: "selColumnSql_",
			            width  : 350,
			            height : 140,
			            enableKeyEvents: true,
			            hideLabel:true,
			            allowBlank:false,
			            blankText:'自定义列表达式不能为空',
			            colspan:5,
			            style: {
	        			 	marginBottom: '10px',
			                imeMode:'disabled'		//屏蔽输入法
			            },
			            listeners:
		            	{
		            		'render':function(e)
		            		{
		            			//屏蔽粘贴和鼠标右键
		            			//Ext.get('selColumnSql_').dom.oncontextmenu = function(e){return false;};
		            			//Ext.get('selColumnSql_').dom.onpaste = function(e){return false;};
		            		}
		            		,'keypress':function(e)
		            		{//屏蔽键盘按键
								//event.keyCode = 0;
								//event.returnvalue = false;
		            		}
		            		
		            	}
			        }		        		 
			        , {
			        	xtype: "button",
	                    text: "1",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
			        }
			        , {
			        	xtype: "button",
	                    text: "2",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "3",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " + ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                , {
			        	xtype: "button",
	                    text: "\'",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
			        }
	                ,{
			        	xtype: "button",
	                    text: "4",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "5",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "6",
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " - ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: ".",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "7",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "8",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "9",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " * ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " % ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "0",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " ( ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " ) ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "/",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " || ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_');}
	                }
	        		,{
	        			xtype: "button",
	                    text: " rank ",
	                    handler: function(){
	                    	var o = new Object();
	                    	o.text = "dense_rank() over (order by    desc)";
	                    	addquery(o,'selColumnSql_');
	                    }
	        		}
	                ,{
			        	xtype: "button",
	                    text: " 清除 ",
	                    handler: function(){
	                    		Ext.getCmp('selColumnSql_').setValue() == "";
									}
	                }
	                ,{
			        	xtype: "button",
	                    text: " 保存 ",
	                    handler: function(){
		                	 if(!Ext.getCmp('selColumnName_').validate())
		                	 {
		                		return;
		                	 }
		                	 if(!Ext.getCmp('selColumnSql_').validate())
							 {
								return;
							 }
							 Ext.getCmp('customH_win_').hide();
							 var li = jQuery("<li oncontextmenu='showmenu(this)'/>");
							 li.attr("id",'column'+number());
							 li.attr("time",defaultDate);
							 li.attr("isAdvanceModel",'true');
							 li.attr("label",Ext.getCmp('selColumnName_').getValue());
							 li.attr("customH",'true');
							 li.attr("column","[customH]"+"("+Ext.getCmp('selColumnSql_').getValue()+")");
							 li.text(Ext.getCmp('selColumnName_').getValue());
							 li.addClass('h');
							 jQuery("#droppableH").find('ul').append(li);
							 var param = {id:'column'+(number()-1),comColumn:'true',table:"("+Ext.getCmp('selColumnSql_').getValue()+")",time:defaultDate,isAdvanceModel:'true',label:Ext.getCmp('selColumnName_').getValue(),customH:'true',column:'[customH]'+"("+Ext.getCmp('selColumnSql_').getValue()+")",text:Ext.getCmp('selColumnName_').getValue()};
							 Ext.getCmp("treeBL").root.appendChild(new Ext.tree.TreeNode(param));
							 Ext.getCmp("treeBL_modify_").root.appendChild(new Ext.tree.TreeNode(param));
							 enable_move();
	                    }
	                }
	                ,{
			        	xtype: "button",
	                    text: " 保存并继续添加 ",
	                    colspan:2,
	                    minWidth:130,
	                    handler: function(){
		                	 if(!Ext.getCmp('selColumnName_').validate())
		                	 {
		                		return;
		                	 }
		                	 if(!Ext.getCmp('selColumnSql_').validate())
							 {
								return;
							 }
							 var li = jQuery("<li oncontextmenu='showmenu(this)'/>");
							 li.attr("id",'column'+number());
							 li.attr("time",defaultDate);
							 li.attr("isAdvanceModel",'true');
							 li.attr("label",Ext.getCmp('selColumnName_').getValue());
							 li.attr("customH",'true');
							 li.attr("column","[customH]"+"("+Ext.getCmp('selColumnSql_').getValue()+")");
							 li.text(Ext.getCmp('selColumnName_').getValue());
							 li.addClass('h');
							 jQuery("#droppableH").find('ul').append(li);
							 var param = {id:'column'+number()-1,comColumn:'true',table:"("+Ext.getCmp('selColumnSql_').getValue()+")",time:defaultDate,isAdvanceModel:'true',label:Ext.getCmp('selColumnName_').getValue(),customH:'true',column:'[customH]'+Ext.getCmp('selColumnSql_').getValue(),text:Ext.getCmp('selColumnName_').getValue()};
							 Ext.getCmp("treeBL").root.appendChild(new Ext.tree.TreeNode(param));
							 Ext.getCmp("treeBL_modify_").root.appendChild(new Ext.tree.TreeNode(param));
							 enable_move();
	                    }
	                }
	        		]
	        	}]})
	        }
	   		]
	 	});//Ext.Window
//by mengqingyu add begin
    
  //树
    var treeBL_modify_ = new Ext.tree.TreePanel({
    	id:'treeBL_modify_',
    	height:608,
		autoScroll: true,
		collapsible: true,
		ddGroup: 'customDDGroup',
		animate:false,
		split: true,
		margins: '2 2 2 2',
		useArrows:true,
		rootVisible : false,
    	loader: new Ext.tree.TreeLoader({    
            preloadChildren: true,//若为true，则loader在节点第一次访问时加载"children"的属性    
            clearOnLoad: false//（可选）默认为true。在读取数据前移除已存在的节点    
        }),    
    	root: Docs.classData,
    	listeners:{
			click:function(node){
				var o = new Object();
				if(node.attributes.comColumn=='true'){
					o.text=node.attributes.table;
				}
				else{
					o.text='$'+node.attributes.table+'.'+node.attributes.column;
				}
	    		addquery(o,'selColumnSql_modify_');
			}
    	}
    });
    
	//标签页
	var tabs_modify_ = new Ext.TabPanel({
		resizeTabs:true, // tab宽度自动调整
		tabWidth:70,		//tab初始宽度
		width:all_width * 20 / 100,
		enableTabScroll:true,//tab超出范围出现横向滚动条
		frame:true,
		activeTab:0,
		region: 'west',
		defaults: {bodyStyle:'background:#dfe8f6;border: 1px solid #dfe8f6'}, 
		items:[{
			id:'tab1_1_modify',
			title:'指标分类',
			layout:'fit',
			items:[{
				width:all_width * 20 / 100,
				autoScroll: true,
				collapsible: true,
				id: 'tree-panel-measures-modify_',
				ddGroup: 'customDDGroup',
				animate:false,
				split: true,
				xtype: 'treepanel',
				margins: '2 2 2 2',
				useArrows:true,
				rootVisible : false,
				root: {text: '指标分类',draggable: false,id: '-1',isRoot:true},
				loader: new Ext.tree.TreeLoader({ 
						dataUrl: getRootPath()+'/detailReport.report?decorate=no',
						listeners:{beforeload:function(treeLoader, node){
							if(node.attributes.isRoot==true){
								this.baseParams.method = "getRoot";
							}else{
								this.baseParams.method = "getChilds";
							}
							this.baseParams.xmlId = xml_id_;
							this.baseParams.tableName = node.attributes.table;
							this.baseParams.pid = node.attributes.pid;
							this.baseParams.level = node.attributes.level;
							this.baseParams.dir = node.attributes.d;
							this.baseParams.time = node.attributes.time;
							this.baseParams.currentTime = jQuery("#currentTime").val();
					   }}
				}),
				listeners:{
					beforeappend:function(tree,parent,node){
	         		//判断是否是报告期
						//if(node.attributes.isTime=='true'){
							//return false;	
						//}else{
							//return true;
						//}
	         	},
				click:function(node){
					if(node.leaf){
						var o = new Object();
						o.text='$'+node.attributes.table+'.'+node.attributes.column;
	            		addquery(o,'selColumnSql_modify_');
					}
				}
				}
			}]	//添加table
		},{
			id:'tab1_2_modify',
			title:'宾栏',
			items:[treeBL_modify_]
		}]
	});
	//by mengqingyu add end
	var advancedColumnWindow_modify_ = new Ext.Window({	
		width:670,	
    	height: 500,
    	layout: "border",
    	title:'修改自定义宾栏',
    	modal: true,
    	border:false,
    	id: "customH_win_modify_",
    	closeAction: 'hide',
	    items: [
	          tabs_modify_
	        ,{
	        	region:'center',
	        	width:320,
	        	height: 500,
	        	margins: '2 2 0 2',
	        	items:new Ext.TabPanel({
	        		activeTab: 0,
	        		items:[
	        		{
	        		title:'高级模式',
	        		layout: 'table',
	        		height: 500,
	        		border:false,
	        		bodyStyle:'padding:10px 10px 10px 20px',
	        		layoutConfig: {columns:5},
	        		defaults:{frame:false,style:'padding:2px',minWidth: '60',style:{marginBottom: '10px'}},
	        		items:[
    		         {
    		    	    id:'selColumnName_modify_',
    		    	    xtype:'textfield',
    		    	    width  : 350,
    		    	    colspan:5,
    		    	    emptyText:'请输入自定义列名称',
    		    	    allowBlank:false,
    		    	    blankText:'自定义列名称不能为空'
    		         },
	        		 {
			            xtype: "textarea",
			            id: "selColumnSql_modify_",
			            width  : 350,
			            height : 140,
			            enableKeyEvents: true,
			            hideLabel:true,
			            allowBlank:false,
			            blankText:'自定义列表达式不能为空',
			            colspan:5,
			            style: {
	        			 	marginBottom: '10px',
			                imeMode:'disabled'		//屏蔽输入法
			            },
			            listeners:
		            	{
		            		'render':function(e)
		            		{
		            			//屏蔽粘贴和鼠标右键
		            			//Ext.get('selColumnSql_modify_').dom.oncontextmenu = function(e){return false;};
		            			//Ext.get('selColumnSql_modify_').dom.onpaste = function(e){return false;};
		            		}
		            		,'keypress':function(e)
		            		{//屏蔽键盘按键
								//event.keyCode = 0;
								//event.returnvalue = false;
		            		}
		            		
		            	}
			        }		        		 
			        , {
			        	xtype: "button",
	                    text: "1",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
			        }
			        , {
			        	xtype: "button",
	                    text: "2",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "3",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " + ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                , {
			        	xtype: "button",
	                    text: "\'",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
			        }
	                ,{
			        	xtype: "button",
	                    text: "4",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "5",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "6",
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " - ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: ".",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "7",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "8",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "9",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " * ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " % ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "0",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " ( ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " ) ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: "/",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	                ,{
			        	xtype: "button",
	                    text: " || ",
	                    style:
	                    {
	                    	marginBottom: '5px'
	                    },
	                    handler: function(){addquery(this,'selColumnSql_modify_');}
	                }
	        		,{
	        			xtype: "button",
	                    text: " rank ",
	                    handler: function(){
	                    	var o = new Object();
	                    	o.text = "dense_rank() over (order by    desc)";
	                    	addquery(o,'selColumnSql_modify_');
	                    }
	        		}
	                ,{
			        	xtype: "button",
	                    text: " 清除 ",
	                    handler: function(){
	                    		Ext.getCmp('selColumnSql_modify_').setValue() == "";
									}
	                }
	                ,{
			        	xtype: "button",
	                    text: " 确认修改 ",
						colspan:3,
						minWidth:200,
	                    handler: function(){
		                	 if(!Ext.getCmp('selColumnName_modify_').validate())
		                	 {
		                		return;
		                	 }
		                	 if(!Ext.getCmp('selColumnSql_modify_').validate())
							 {
								return;
							 }
					 Ext.getCmp('customH_win_modify_').hide();
					 Ext.getCmp('customH_win_modify_').evObject.id=Ext.getCmp('customH_win_modify_').evObject.id;
					 Ext.getCmp('customH_win_modify_').evObject.time=defaultDate;
					 Ext.getCmp('customH_win_modify_').evObject.isAdvanceModel='true';
					 Ext.getCmp('customH_win_modify_').evObject.label=Ext.getCmp('selColumnName_modify_').getValue();
					 Ext.getCmp('customH_win_modify_').evObject.column="[customH]"+Ext.getCmp('selColumnSql_modify_').getValue();
					 Ext.getCmp('customH_win_modify_').evObject.innerText = Ext.getCmp('selColumnName_modify_').getValue();
					 Ext.getCmp('customH_win_modify_').evObject.outerHTML = "<li id='"+Ext.getCmp('customH_win_modify_').evObject.id+"' time='"+defaultDate+"' isAdvanceModel='true' oncontextmenu='showmenu(this)' ondblclick='modify(this);' label='"+Ext.getCmp('selColumnName_modify_').getValue()+"' customH='true' column='[customH]"+Ext.getCmp('selColumnSql_modify_').getValue()+"' class='h'>"+Ext.getCmp('selColumnName_modify_').getValue()+"</li>";
					 var nodeId = Ext.getCmp('customH_win_modify_').evObject.id;
					 Ext.getCmp("treeBL").getNodeById(nodeId).remove();//删除宾栏树
					 Ext.getCmp("treeBL_modify_").getNodeById(nodeId).remove();//删除宾栏树
					 var param = {id:nodeId,comColumn:'true',table:"("+Ext.getCmp('selColumnSql_modify_').getValue()+")",time:defaultDate,isAdvanceModel:'true',label:Ext.getCmp('selColumnName_modify_').getValue(),customH:'true',column:'[customH]'+Ext.getCmp('selColumnSql_modify_').getValue(),text:Ext.getCmp('selColumnName_modify_').getValue()};
					 Ext.getCmp("treeBL").root.appendChild(new Ext.tree.TreeNode(param));
					 Ext.getCmp("treeBL_modify_").root.appendChild(new Ext.tree.TreeNode(param));
					 enable_move();
	                    }
	                }
	        		]
	        	}]})
	        }
	   		]
	 	});//Ext.Window
	

});	
//更新指标 by mengqingyu
function getWinMeasure(data,textValue){
	var comboBoxMeasure = new Ext.ux.form.ComboBox({
		id:'comboBoxMeasureId',
		data:data,   
		anchor:'95%',
		emptyText : "请选择指标",
		selectOnFocus : true,	
		allowBlank:false,
		fieldLabel:'新指标'
	});
	var formMeasure = new Ext.FormPanel({
		id:'formMeasure',
		frame:true,
		items:[{
			xtype:'textfield',
			anchor:'95%',
			fieldLabel:'原指标',
			disabled:true,
			value:textValue
		},comboBoxMeasure],
	    buttons:[{
        text:'确定',
        xtype:'button',
        handler:function(){
			if(!formMeasure.getForm().isValid()){
				Ext.Msg.alert("提示","有未填内容！");
			    return;
		    }
	  		Ext.MessageBox.confirm("注意","确定更新指标？",
					function(button,text){
			  			if(button=="yes"){
			  				updateMeasure();
			  				winMeasure.close();
			  			}
					}
			);	
         }
	    }]
	});	
	var winMeasure = new Ext.Window({//添加/修改菜单弹出窗口
		id:'winMeasure',
		title:'更新指标',
		width: 380,
		height:150,
		layout: 'fit',
		modal:true,
		closeAction:'close',
		buttonAlign:'center',
		resizable:false,
		items: [formMeasure]
	});
	return winMeasure;
}
